/*
 * @Author: yxfan
 * @Date: 2023-11-04 16:06:04
 * @LastEditTime: 2023-11-04 16:19:28
 * @FilePath: /umi-demo/src/pages/test/useContext/components/Son2.js
 * @Description:
 */
import { useDispatch } from 'umi';
import { memo } from 'react';

export default memo(() => {
    const dispatch = useDispatch();

    function add() {
        dispatch({
            type: 'useSelector/addNum',
            payload: 1,
        });
    }
    console.log('子节点2 render');
    return (
        <div>
            子节点2
            <button onClick={add}>+</button>
        </div>
    );
});
